<template>
  <div class="headerView">
    <img src="@/assets/images/logo.png" @click="goHome" alt="">
    <!-- 搜索区域 -->
    <div class="search" @click="goSearch">
      <span class="iconfont icon-search"></span>
    </div>
  </div>
</template>

<script>
export default {
  methods: {
    goHome () {
      if (this.$route.path != '/index') {
        this.$router.replace('/index')
      }
    },
    goSearch () {
      this.$router.push('/search')
    }
  }
}
</script>

<style lang="less" scoped>
.headerView{
  width: 100%;
  height: 1rem;
  background-color: #31c27c;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0.3rem;
  img{
    height: 0.8rem;
  }
  .search{
    color: #fff;
    span{
     font-size: 0.7rem;
     display:block;
    }
  }
}
</style>
